<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <form th:action="@{/user/findAll(pageIndex=1)}" method="post">
        姓名：<input type="text" name="name" th:value="${name}" placeholder="请输入姓名">
        <input type="submit" value="搜索">
        <a href="/user/toAdd">添加</a>
        <table>
            <tr>
                <td>序号</td>
                <td>姓名</td>
                <td>年龄</td>
                <td>性别</td>
                <td>生日</td>
                <td>操作</td>
            </tr>
            <tr th:each="user:${page.getRecords()}">
                <td th:text="${user.id}"/>
                <td th:text="${user.name}"/>
                <td th:text="${user.age}"/>
                <td th:text="${user.sex}"/>
                <td th:text="${#dates.format(user.birth,'yyyy-MM-dd')}"/>
                <td>
                    <a th:href="@{/user/findById(id=${user.id})}">修改</a>
                    <a th:href="@{/user/delete(id=${user.id})}">删除</a>
                </td>
            </tr>
        </table>
    </form>
    <a th:href="@{/user/findAll(pageIndex=1)}">首页</a>
    <a th:href="@{/user/findAll(pageIndex=${page.getCurrent()-1})}">上一页</a>
    <a th:href="@{/user/findAll(pageIndex=${page.getCurrent()+1})}">下一页</a>
    <a th:href="@{/user/findAll(pageIndex=${page.getPages()})}">尾页</a>
   <!-- 第<span th:text="${page.getCurrent()}"></span>页/共<span th:text="${page.getPages()}"></span>页
    共<span th:text="${page.getTotal()}"></span>条数据-->
</body>
</html>
